﻿using LiveCharts;
using MES.Desktop.Models;
using Prism.Commands;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MES.Desktop.ViewModels
{
    public class WorkbenchesViewModel
    {
        public string PageTitle { get; set; } = "工作台";
        public bool IsCanClose { get; set; } = false;

        public ChartValues<double> ChartSeries1 { get; set; } =
            new ChartValues<double> { 246, 159, 265, 114, 182, 269, 170, 133, 228, 298, 143, 104, 130, 287, 183, 268, 153, 141, 269, 256 };
        public ChartValues<double> ChartSeries2 { get; set; } =
            new ChartValues<double> { 167, 103, 240, 174, 177, 105, 228, 196, 212, 242, 180, 244, 181, 198, 224, 273, 293, 116, 146, 256 };
        public ChartValues<double> ChartSeries3 { get; set; } =
            new ChartValues<double> { 80, 94, 86, 84, 87, 90, 81, 88, 85, 82, 83, 90, 84, 96, 81, 93, 89, 87, 98, 80 };

        public ObservableCollection<TaskModel> TaskList { get; set; } =
            new ObservableCollection<TaskModel>();

        public Func<double, string> GaugeLabelFormater { get; set; } =
            new Func<double, string>(v => v.ToString("P0"));

        public DelegateCommand CloseCommand { get; set; }

        public WorkbenchesViewModel()
        {
            TaskList.Add(new TaskModel { TaskHeader = "工单 20758594 待审批", Color = "#4C8EFC" });
            TaskList.Add(new TaskModel { TaskHeader = "设备ZH032运行异常，现已停工，等待维修", Color = "#FB7F8B" });
            TaskList.Add(new TaskModel { TaskHeader = "新的生成指令单MO等待派工", Color = "#4C8EFC" });
            TaskList.Add(new TaskModel { TaskHeader = "PL6038U-冲压工序说明更新了新版本，请上传到图纸管理系统", Color = "#60D69A" });
            TaskList.Add(new TaskModel { TaskHeader = "班级 X09 提交上料申请", Color = "#4C8EFC" });
            TaskList.Add(new TaskModel { TaskHeader = "设备ZH032运行异常，现已停工，等待维修", Color = "#FB7F8B" });
            TaskList.Add(new TaskModel { TaskHeader = "工单 20758594 待审批", Color = "#4C8EFC" });
        }
    }
}
